﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Framework.UI.Controls"
                    xmlns:params="http://schemas.codeplex.com/elysium/params">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/Brush.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/Icon.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/GeometryIcon.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!-- Validation -->
    <ControlTemplate x:Key="ValidationErrorControlTemplate">
        <!-- Empty -->
    </ControlTemplate>

    <ControlTemplate x:Key="SmallWarningValidationErrorControlTemplate">
        <StackPanel Orientation="Horizontal">
            <AdornedElementPlaceholder/>
            <controls:Icon Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" 
                           Style="{StaticResource WarningMessageIconStyle}">
                <controls:Icon.ToolTip>
                    <ItemsControl ItemsSource="{Binding}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding ErrorContent}"/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </controls:Icon.ToolTip>
            </controls:Icon>
        </StackPanel>
    </ControlTemplate>
    
    <ControlTemplate x:Key="LargeWarningValidationErrorControlTemplate">
        <StackPanel Orientation="Horizontal">
            <AdornedElementPlaceholder/>
            <controls:Icon Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}" 
                           Size="Medium"
                           Style="{StaticResource WarningMessageIconStyle}">
                <controls:Icon.ToolTip>
                    <ItemsControl ItemsSource="{Binding}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding ErrorContent}"/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </controls:Icon.ToolTip>
            </controls:Icon>
        </StackPanel>
    </ControlTemplate>
    
    <ControlTemplate x:Key="InternalSmallWarningValidationErrorControlTemplate">
        <Grid>
            <AdornedElementPlaceholder/>
            <controls:Icon HorizontalAlignment="Right"
                           Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}" 
                           Style="{StaticResource WarningMessageIconStyle}"
                           VerticalAlignment="Center">
                <controls:Icon.ToolTip>
                    <ItemsControl ItemsSource="{Binding}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding ErrorContent}"/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </controls:Icon.ToolTip>
            </controls:Icon>
        </Grid>
    </ControlTemplate>
    
    <ControlTemplate x:Key="LeftSmallWarningValidationErrorControlTemplate">
        <StackPanel Orientation="Horizontal">
            <controls:Icon HorizontalAlignment="Left"
                           Margin="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}" 
                           Style="{StaticResource WarningMessageIconStyle}"
                           VerticalAlignment="Center">
                <controls:Icon.ToolTip>
                    <ItemsControl ItemsSource="{Binding}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding ErrorContent}"/>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </controls:Icon.ToolTip>
            </controls:Icon>
            <AdornedElementPlaceholder/>
        </StackPanel>
    </ControlTemplate>
    
    <ToolTip x:Key="ValidationErrorToolTip"
             DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}">
        <ItemsControl ItemsSource="{Binding Path=(Validation.Errors)}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding ErrorContent}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </ToolTip>

</ResourceDictionary>